const {defineConfig} = require('@vue/cli-service')
module.exports = defineConfig({
    transpileDependencies: true,
    lintOnSave: false,
    devServer: {
        host: '0.0.0.0',
        port: 8080,
        client: {
            webSocketURL: 'ws://localhost:8080/ws',
        },
        headers: {
            'Access-Control-Allow-Origin': '*',
        },
        proxy: {
            '/api': {
                target: 'http://iwenwiki.com:3000', // 目标的地址，请求的后台接口
                ws: true,
                changeOrigin: true,
                pathRewrite: { // 路径重写
                    "^/api": '',
                }
            },
            '/foo': {
                target: 'https://interface.music.163.com', // 目标的地址，请求的后台接口
                ws: true,
                changeOrigin: true,
                pathRewrite: { // 路径重写
                    "^/foo": '',
                }
            },
            '/boo': {
                target: 'https://music.163.com', // 目标的地址，请求的后台接口
                ws: true,
                changeOrigin: true,
                pathRewrite: { // 路径重写
                    "^/boo": '',
                }
            },
        }
    }
})
